
wx.config({
  debug: false,
  appId: wxConfig.appId,
  timestamp: wxConfig.timestamp,
  nonceStr: wxConfig.nonceStr,
  signature: wxConfig.signature,

  jsApiList: [
    'checkJsApi',
    'onMenuShareTimeline',
    'onMenuShareAppMessage',
    'onMenuShareQQ',
    'onMenuShareWeibo',
    'hideMenuItems',
    'showMenuItems',
    'hideAllNonBaseMenuItem',
    'showAllNonBaseMenuItem',
    'translateVoice',
    'startRecord',
    'stopRecord',
    'onRecordEnd',
    'playVoice',
    'pauseVoice',
    'stopVoice',
    'uploadVoice',
    'downloadVoice',
    'chooseImage',
    'previewImage',
    'uploadImage',
    'downloadImage',
    'getNetworkType',
    'openLocation',
    'getLocation',
    'hideOptionMenu',
    'showOptionMenu',
    'closeWindow',
    'scanQRCode',
    'chooseWXPay',
    'openProductSpecificView',
    'addCard',
    'chooseCard',
    'openCard'
  ]
});



wx.ready(function() {
  wx.onMenuShareAppMessage(shareData);
  wx.onMenuShareTimeline(shareData);
  wx.hideMenuItems({
    menuList: [
    'menuItem:originPage',
    'menuItem:openWithQQBrowser',
    'menuItem:copyUrl',
    'menuItem:openWithSafari'
    ],
  });
});
wx.error(function(res) {
  console.log('微信分享错误：'+res.errMsg);
});


// 判断是否为微信
function isWechat() {
  var ua = navigator.userAgent.toLowerCase();
  if (ua.match(/MicroMessenger/i) == "micromessenger") {
    return true;
  } else {
    return false;
  }
}
$('#header').show();
$('#btn-install-app').on('click', function() {
  window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.lalocal.lalocal';
});


/**
 *判断手机系统
 */
function checkMobileOS() {
  var u = navigator.userAgent;
  if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机
  console.log("安卓手机");
  return 'android';
  } else if (u.indexOf('iPhone') > -1) {//苹果手机
  console.log("苹果手机");
  return 'ios';
  } else if (u.indexOf('Windows Phone') > -1) {//winphone手机
  console.log("winphone手机");
  return 'wp';
  }
}
// if (isWechat()) {
//   $('#btn-install-app').on('click', function() {
//     $('.qrcode-block').slideDown();
//   });
//
//   $('.qrcode-block').on('click', function() {
//     $('.qrcode-block').slideUp();
//   });
// }
// else {
//   $('#btn-install-app').on('click', function() {
//     window.location.href = "https://itunes.apple.com/cn/app/lalocal-le-ke-lu-xing-lu-you/id1013595261";
//   });
// }
